﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LogManager.Base;
using LogManager.Base.Windows;
using Raven.Client.Indexes;

namespace LogManager.Storage.Indexes
{
    /// <summary>
    /// Index to get all of type ilog
    /// note: http://www.philliphaydon.com/2011/12/ravendb-inheritance-revisited/
    /// </summary>
    class AllLogs : AbstractMultiMapIndexCreationTask
    {
        public AllLogs()
        {
            AddMap<WindowsLog>(
                wlogs => wlogs.Select(wl => new
                                               {
                                                   wl.Id, 
                                                   wl.LogName, 
                                                   wl.Server, 
                                                   wl.LastWriteTime, 
                                                   wl.RecordCount
                                               }));
        }
    }
}
